<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>使用手动触发的方式处理事件</title>
    <script type="text/javascript">
        function myTest() {
            var msg = "通过不同的方式返回不同的结果：\n\n";
            msg += "单击“测试”按钮，即可直接提交表单\n";
            msg += "单击“确定”按钮，即可促发onsubmit()方法，然后才提交表单\n";
            alert(msg);
        }
    </script>
</head>
<body>
<center>
    <form name="myForm1" id="myForm1" onsubmit="myTest()" method="post" action="8.1.html">
        <input type="button" value="测试" onclick="document.all.myForm1.submit();">
        <input type="submit" value="确定" >
    </form>

</center>
</body>
</html>